#ifndef MICORSTRAIN_3DM_GX2_H_
#define MICORSTRAIN_3DM_GX2_H_

#include <stdio.h>
#include "./Inertial_measurement.h"
#include "./Serial_port.h"

using namespace std;

//Defined in Serial_port.h
//#define EVEN_PARITY 0;
//#define ODD_PARITY 1;
//#define NO_PARITY 2;
//#define SPACE_PARITY 3;

class MicroStrain_3DM_GX2 {

public:
	MicroStrain_3DM_GX2();
	~MicroStrain_3DM_GX2();

	int open();
	int close();
	int run();
	int stop();
	Inertial_measurement* read();
	int read_word_from_EEPROM(unsigned short*,unsigned short*);

private:
	Serial_port serial_port;
	unsigned char *write_buffer;
	unsigned char *read_buffer;

	int measurement_nr;
	int continuous_mode_set;
	int calculate_checksum(unsigned char *data, int length, unsigned short *checksum);
};


#endif // MICORSTRAIN_3DM_GX2_H_
